package herd;

import utils.Position;
import utils.PositionMath;

public class Krill{
    private Position position;
    private double fitnessValue;
    private Position motionInduced;
    private Position foragingMotion;
    private Position diffusionMotion;
    //When to set this to better one?
    //Perhaps when calculating fitness
    private Position bestPosition;
    private double bestPositionFitness;

    private static PositionMath positionMath = new PositionMath();

    public Krill(Position position) {
        this.position = position;
    }

    public void updatePosition(){
        Position newPosition  = positionMath.addPositions(motionInduced,foragingMotion);
        positionMath.addPositionsImplicitly(newPosition,diffusionMotion);
        position = newPosition;
    }

    public Position getPosition() {
        return position;
    }

    public void setPosition(Position position) {
        this.position = position;
    }

    public double getFitnessValue() {
        return fitnessValue;
    }

    public void setFitnessValue(double fitnessValue) {
        this.fitnessValue = fitnessValue;
    }

    public Position getMotionInduced() {
        return motionInduced;
    }

    public void setMotionInduced(Position motionInduced) {
        this.motionInduced = motionInduced;
    }

    public Position getForagingMotion() {
        return foragingMotion;
    }

    public void setForagingMotion(Position foragingMotion) {
        this.foragingMotion = foragingMotion;
    }

    public Position getBestPosition() {
        return bestPosition;
    }

    public void setBestPosition(Position bestPosition) {
        this.bestPosition = bestPosition;
    }

    public double getBestPositionFitness() {
        return bestPositionFitness;
    }

    public void setBestPositionFitness(double bestPositionFitness) {
        this.bestPositionFitness = bestPositionFitness;
    }

    public Position getDiffusionMotion() {
        return diffusionMotion;
    }

    public void setDiffusionMotion(Position diffusionMotion) {
        this.diffusionMotion = diffusionMotion;
    }
}


